package com.sinsoft.monitorDemo.dao;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

import redis.clients.jedis.Jedis;

import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.sinsoft.monitorDemo.entity.OracleInfo;
import com.sinsoft.monitorDemo.util.JsonUtil;
import com.sinsoft.monitorDemo.util.RedisUtil;

public class OracleInfoDao {

	public List<OracleInfo> getOracleInfoList(String ip){
		Jedis jedis = RedisUtil.getJedis();
		List<String> jsonList = jedis.lrange("StatusData_"+ip+"_ORACLERAC_latest", 1, -1);
		JsonArray jsonArray = null;
		JsonObject jsonObject = null;
		OracleInfo oracleInfo =null;
		List<OracleInfo> oracleInfos = new ArrayList<OracleInfo>();
		if(jsonList.size()>10){
			for (int i = jsonList.size()-10; i < jsonList.size(); i++) {
				jsonArray = JsonUtil.JsonParse(jsonList.get(i));
				jsonObject = jsonArray.get(0).getAsJsonObject();
				if ("off".equals(jsonObject.get("status").getAsString().toLowerCase())) {
					if("online".equals(jsonObject.get("css_status").getAsString())&&"online".equals(jsonObject.get("ohas_status").getAsString())&&"online".equals(jsonObject.get("crs_status").getAsString())){
						//取asm运行状态
						JsonObject asmStatusJson = (JsonObject)jsonObject.get("asm_status");
						Set<Entry<String, JsonElement>> asmStatusSet = asmStatusJson.entrySet();
						Map<String, Object> asmStatus = new HashMap<String, Object>();
						Map<String, String> asmDetailsMap = new HashMap<String, String>();
						for (Entry<String, JsonElement> entry : asmStatusSet) {
							JsonObject asmStatusObject = (JsonObject)entry.getValue();
							Set<Entry<String, JsonElement>> asmStatusEntrySet = asmStatusObject.entrySet();
							for (Entry<String, JsonElement> entry2 : asmStatusEntrySet) {
								asmDetailsMap.put(entry2.getKey(), entry2.getValue().toString());
							}
							asmStatus.put(entry.getKey(), asmDetailsMap);
						}
						//取磁盘组运行状态
						JsonObject diskStatusJson = (JsonObject)jsonObject.get("diskgroup_status");
						Set<Entry<String, JsonElement>> diskStatusSet = diskStatusJson.entrySet();
						Map<String, Object> diskGroupStatus = new HashMap<String, Object>();
						Map<String, String> diskGroupDetailsMap = new HashMap<String, String>();
						for (Entry<String, JsonElement> entry : diskStatusSet) {
							JsonObject diskGroupStatusObject = (JsonObject)entry.getValue();
							Set<Entry<String, JsonElement>> diskStatusEntrySet = diskGroupStatusObject.entrySet();
							for (Entry<String, JsonElement> entry2 : diskStatusEntrySet) {
								diskGroupDetailsMap.put(entry2.getKey(), entry2.getValue().toString());
							}
							diskGroupStatus.put(entry.getKey(), diskGroupDetailsMap);
						}
						//监听运行状态
						JsonObject listenStatusJson = (JsonObject)jsonObject.get("listen_status");
						Set<Entry<String, JsonElement>> listenStatusSet = listenStatusJson.entrySet();
						Map<String, Object> listenStatus = new HashMap<String, Object>();
						Map<String, String> listenDetailsMap = new HashMap<String, String>();
						for (Entry<String, JsonElement> entry : listenStatusSet) {
							JsonObject listenStatusObject = (JsonObject)entry.getValue();
							Set<Entry<String, JsonElement>> listenStatusEntrySet = listenStatusObject.entrySet();
							for (Entry<String, JsonElement> entry2 : listenStatusEntrySet) {
								listenDetailsMap.put(entry2.getKey(), entry2.getValue().toString());
							}
							listenStatus.put(entry.getKey(), listenDetailsMap);
						}
						//网络IP状态
						JsonObject netIpStatusJson = (JsonObject)jsonObject.get("net_ip_status");
						Set<Entry<String, JsonElement>> netIpStatusSet = netIpStatusJson.entrySet();
						Map<String, Object> netIpStatus = new HashMap<String, Object>();//网络IP状态
						Map<String, String> netIpDetailsMap = new HashMap<String, String>();
						for (Entry<String, JsonElement> entry : netIpStatusSet) {
							entry.getKey();
							JsonObject statusDetails = (JsonObject)entry.getValue();
							Set<Entry<String, JsonElement>> statusDetailsSet = statusDetails.entrySet();
							for (Entry<String, JsonElement> entry2 : statusDetailsSet) {
								netIpDetailsMap.put(entry2.getKey(), entry2.getValue().toString());
							}
							netIpStatus.put(entry.getKey(), netIpDetailsMap);
						}
						//实例运行状态
						JsonObject instanceJson = (JsonObject)jsonObject.get("instance_status");
						Set<Entry<String, JsonElement>> instanceSet = instanceJson.entrySet();
						Map<String, Object> instanceStatus = new HashMap<String, Object>();
						Map<String, String> instanceDetailsMap = new HashMap<String, String>();
						for (Entry<String, JsonElement> entry : instanceSet) {
							JsonObject instanceStatusObject = (JsonObject)entry.getValue();
							Set<Entry<String, JsonElement>> instanceStatusEntrySet = instanceStatusObject.entrySet();
							for (Entry<String, JsonElement> entry2 : instanceStatusEntrySet) {
								instanceDetailsMap.put(entry2.getKey(), entry2.getValue().toString());
							}
							instanceStatus.put(entry.getKey(), instanceDetailsMap);
						}
						//端口状态
						jsonObject = jsonArray.get(0).getAsJsonObject();
						JsonArray array = jsonObject.get("port_status").getAsJsonArray();
						Map<String, Object> portStatus = new HashMap<String, Object>();
						for (int j = 0; j < array.size(); j++) {
							JsonArray array2 = array.get(j).getAsJsonArray();
							String key = array2.get(0).getAsString();
							String value = array2.get(1).getAsString();
							portStatus.put(key, value);
						}
						String tmpfsTotalString = jsonObject.get("tmpfs_total").getAsString();
						Double tmpfsTotal = Double.valueOf(tmpfsTotalString.substring(0,tmpfsTotalString.length()-1));
						oracleInfo = new OracleInfo(jsonObject.get("tmpfs_used_per").getAsDouble(), tmpfsTotal, 
								null, jsonObject.get("status").getAsString(), jsonObject.get("process_current").getAsInt(), 
								null, null, 
								null, jsonObject.get("ohas_status").getAsString(), jsonObject.get("crs_status").getAsString(),
								jsonObject.get("css_status").getAsString(), asmStatus, diskGroupStatus, listenStatus, 
								netIpStatus, instanceStatus, null,portStatus,jsonArray.get(1).getAsLong(),ip);
						oracleInfos.add(oracleInfo);
					}else {
						//端口状态
						jsonObject = jsonArray.get(0).getAsJsonObject();
						JsonArray array = jsonObject.get("port_status").getAsJsonArray();
						Map<String, Object> portStatus = new HashMap<String, Object>();
						for (int j = 0; j < array.size(); j++) {
							JsonArray array2 = array.get(j).getAsJsonArray();
							String key = array2.get(0).getAsString();
							String value = array2.get(1).getAsString();
							portStatus.put(key, value);
						}
						String tmpfsTotalString = jsonObject.get("tmpfs_total").getAsString();
						Double tmpfsTotal = Double.valueOf(tmpfsTotalString.substring(0,tmpfsTotalString.length()-1));
						oracleInfo = new OracleInfo(jsonObject.get("tmpfs_used_per").getAsDouble(), tmpfsTotal, 
								null, jsonObject.get("status").getAsString(), jsonObject.get("process_current").getAsInt(), 
								null, null, 
								null, jsonObject.get("ohas_status").getAsString(), jsonObject.get("crs_status").getAsString(),
								jsonObject.get("css_status").getAsString(), null, null, null, 
								null, null, null,portStatus,jsonArray.get(1).getAsLong(),ip);
						oracleInfos.add(oracleInfo);
					}
				}else {
					if("online".equals(jsonObject.get("css_status").getAsString())&&"online".equals(jsonObject.get("ohas_status").getAsString())&&"online".equals(jsonObject.get("crs_status").getAsString())){
						//取asm运行状态
						JsonObject asmStatusJson = (JsonObject)jsonObject.get("asm_status");
						Set<Entry<String, JsonElement>> asmStatusSet = asmStatusJson.entrySet();
						Map<String, Object> asmStatus = new HashMap<String, Object>();
						Map<String, String> asmDetailsMap = new HashMap<String, String>();
						for (Entry<String, JsonElement> entry : asmStatusSet) {
							JsonObject asmStatusObject = (JsonObject)entry.getValue();
							Set<Entry<String, JsonElement>> asmStatusEntrySet = asmStatusObject.entrySet();
							for (Entry<String, JsonElement> entry2 : asmStatusEntrySet) {
								asmDetailsMap.put(entry2.getKey(), entry2.getValue().toString());
							}
							asmStatus.put(entry.getKey(), asmDetailsMap);
						}
						//取磁盘组运行状态
						JsonObject diskStatusJson = (JsonObject)jsonObject.get("diskgroup_status");
						Set<Entry<String, JsonElement>> diskStatusSet = diskStatusJson.entrySet();
						Map<String, Object> diskGroupStatus = new HashMap<String, Object>();
						Map<String, String> diskGroupDetailsMap = new HashMap<String, String>();
						for (Entry<String, JsonElement> entry : diskStatusSet) {
							JsonObject diskGroupStatusObject = (JsonObject)entry.getValue();
							Set<Entry<String, JsonElement>> diskStatusEntrySet = diskGroupStatusObject.entrySet();
							for (Entry<String, JsonElement> entry2 : diskStatusEntrySet) {
								diskGroupDetailsMap.put(entry2.getKey(), entry2.getValue().toString());
							}
							diskGroupStatus.put(entry.getKey(), diskGroupDetailsMap);
						}
						//监听运行状态
						JsonObject listenStatusJson = (JsonObject)jsonObject.get("listen_status");
						Set<Entry<String, JsonElement>> listenStatusSet = listenStatusJson.entrySet();
						Map<String, Object> listenStatus = new HashMap<String, Object>();
						Map<String, String> listenDetailsMap = new HashMap<String, String>();
						for (Entry<String, JsonElement> entry : listenStatusSet) {
							JsonObject listenStatusObject = (JsonObject)entry.getValue();
							Set<Entry<String, JsonElement>> listenStatusEntrySet = listenStatusObject.entrySet();
							for (Entry<String, JsonElement> entry2 : listenStatusEntrySet) {
								listenDetailsMap.put(entry2.getKey(), entry2.getValue().toString());
							}
							listenStatus.put(entry.getKey(), listenDetailsMap);
						}
						//网络IP状态
						JsonObject netIpStatusJson = (JsonObject)jsonObject.get("net_ip_status");
						Set<Entry<String, JsonElement>> netIpStatusSet = netIpStatusJson.entrySet();
						Map<String, Object> netIpStatus = new HashMap<String, Object>();//网络IP状态
						Map<String, String> netIpDetailsMap = new HashMap<String, String>();
						for (Entry<String, JsonElement> entry : netIpStatusSet) {
							entry.getKey();
							JsonObject statusDetails = (JsonObject)entry.getValue();
							Set<Entry<String, JsonElement>> statusDetailsSet = statusDetails.entrySet();
							for (Entry<String, JsonElement> entry2 : statusDetailsSet) {
								netIpDetailsMap.put(entry2.getKey(), entry2.getValue().toString());
							}
							netIpStatus.put(entry.getKey(), netIpDetailsMap);
						}
						//实例运行状态
						JsonObject instanceJson = (JsonObject)jsonObject.get("instance_status");
						Set<Entry<String, JsonElement>> instanceSet = instanceJson.entrySet();
						Map<String, Object> instanceStatus = new HashMap<String, Object>();
						Map<String, String> instanceDetailsMap = new HashMap<String, String>();
						for (Entry<String, JsonElement> entry : instanceSet) {
							JsonObject instanceStatusObject = (JsonObject)entry.getValue();
							Set<Entry<String, JsonElement>> instanceStatusEntrySet = instanceStatusObject.entrySet();
							for (Entry<String, JsonElement> entry2 : instanceStatusEntrySet) {
								instanceDetailsMap.put(entry2.getKey(), entry2.getValue().toString());
							}
							instanceStatus.put(entry.getKey(), instanceDetailsMap);
						}
						//表空间使用率
						JsonObject tablespaceJson = (JsonObject)jsonObject.get("tablespace_used_per");
						Set<Entry<String, JsonElement>> tablespaceSet = tablespaceJson.entrySet();
						Map<String, Object> tablespaceUsedPer = new HashMap<String, Object>();//网络IP状态
						for (Entry<String, JsonElement> entry : tablespaceSet) {
							tablespaceUsedPer.put(entry.getKey(), entry.getValue().getAsDouble());
						}
						//端口状态
						jsonObject = jsonArray.get(0).getAsJsonObject();
						JsonArray array = jsonObject.get("port_status").getAsJsonArray();
						Map<String, Object> portStatus = new HashMap<String, Object>();
						for (int j = 0; j < array.size(); j++) {
							JsonArray array2 = array.get(j).getAsJsonArray();
							String key = array2.get(0).getAsString();
							String value = array2.get(1).getAsString();
							portStatus.put(key, value);
						}
						Integer connections = null;
						if(jsonObject.get("connections") != null){
							connections = jsonObject.get("connections").getAsInt();
						}
						Integer connectionsActive = null;
						if(jsonObject.get("connections_active") != null){
							connectionsActive = jsonObject.get("connections_active").getAsInt();
						}
						
						Integer maxConnections = null;
						if(jsonObject.get("max_connections") != null){
							maxConnections = jsonObject.get("max_connections").getAsInt();
						}
						Double memoryTarget =null;
						if(jsonObject.get("memory_target") != null){
							memoryTarget = jsonObject.get("memory_target").getAsDouble();
						}
						String tmpfsTotalString = jsonObject.get("tmpfs_total").getAsString();
						Double tmpfsTotal = Double.valueOf(tmpfsTotalString.substring(0,tmpfsTotalString.length()-1));
						oracleInfo = new OracleInfo(jsonObject.get("tmpfs_used_per").getAsDouble(), tmpfsTotal, 
								memoryTarget, jsonObject.get("status").getAsString(), jsonObject.get("process_current").getAsInt(), 
								connections, connectionsActive, 
								maxConnections, jsonObject.get("ohas_status").getAsString(), jsonObject.get("crs_status").getAsString(),
								jsonObject.get("css_status").getAsString(), asmStatus, diskGroupStatus, listenStatus, 
								netIpStatus, instanceStatus, tablespaceUsedPer,portStatus,jsonArray.get(1).getAsLong(),ip);
						oracleInfos.add(oracleInfo);
					}else {
						
						//表空间使用率
						JsonObject tablespaceJson = (JsonObject)jsonObject.get("tablespace_used_per");
						Set<Entry<String, JsonElement>> tablespaceSet = tablespaceJson.entrySet();
						Map<String, Object> tablespaceUsedPer = new HashMap<String, Object>();//网络IP状态
						for (Entry<String, JsonElement> entry : tablespaceSet) {
							tablespaceUsedPer.put(entry.getKey(), entry.getValue().getAsDouble());
						}
						//端口状态
						jsonObject = jsonArray.get(0).getAsJsonObject();
						JsonArray array = jsonObject.get("port_status").getAsJsonArray();
						Map<String, Object> portStatus = new HashMap<String, Object>();
						for (int j = 0; j < array.size(); j++) {
							JsonArray array2 = array.get(j).getAsJsonArray();
							String key = array2.get(0).getAsString();
							String value = array2.get(1).getAsString();
							portStatus.put(key, value);
						}
						Integer connections = null;
						if(jsonObject.get("connections") != null){
							connections = jsonObject.get("connections").getAsInt();
						}
						Integer connectionsActive = null;
						if(jsonObject.get("connections_active") != null){
							connectionsActive = jsonObject.get("connections_active").getAsInt();
						}
						
						Integer maxConnections = null;
						if(jsonObject.get("max_connections") != null){
							maxConnections = jsonObject.get("max_connections").getAsInt();
						}
						Double memoryTarget =null;
						if(jsonObject.get("memory_target") != null){
							memoryTarget = jsonObject.get("memory_target").getAsDouble();
						}
						String tmpfsTotalString = jsonObject.get("tmpfs_total").getAsString();
						Double tmpfsTotal = Double.valueOf(tmpfsTotalString.substring(0,tmpfsTotalString.length()-1));
						oracleInfo = new OracleInfo(jsonObject.get("tmpfs_used_per").getAsDouble(), tmpfsTotal, 
								memoryTarget, jsonObject.get("status").getAsString(), jsonObject.get("process_current").getAsInt(), 
								connections, connectionsActive, 
								maxConnections, jsonObject.get("ohas_status").getAsString(), jsonObject.get("crs_status").getAsString(),
								jsonObject.get("css_status").getAsString(), null, null, null, 
								null, null, tablespaceUsedPer,portStatus,jsonArray.get(1).getAsLong(),ip);
						oracleInfos.add(oracleInfo);
						
					}
				}
			}
			
		}else {
			for (int i = 0; i < jsonList.size(); i++) {
				jsonArray = JsonUtil.JsonParse(jsonList.get(i));
				jsonObject = jsonArray.get(0).getAsJsonObject();
				System.out.println(jsonObject.get("css_status").getAsString());
				System.out.println(jsonObject.get("status").getAsString().toLowerCase());
				if ("off".equals(jsonObject.get("status").getAsString().toLowerCase())) {
					if("online".equals(jsonObject.get("css_status").getAsString())&&"online".equals(jsonObject.get("ohas_status").getAsString())&&"online".equals(jsonObject.get("crs_status").getAsString())){
						//取asm运行状态
						JsonObject asmStatusJson = (JsonObject)jsonObject.get("asm_status");
						Set<Entry<String, JsonElement>> asmStatusSet = asmStatusJson.entrySet();
						Map<String, Object> asmStatus = new HashMap<String, Object>();
						Map<String, String> asmDetailsMap = new HashMap<String, String>();
						for (Entry<String, JsonElement> entry : asmStatusSet) {
							JsonObject asmStatusObject = (JsonObject)entry.getValue();
							Set<Entry<String, JsonElement>> asmStatusEntrySet = asmStatusObject.entrySet();
							for (Entry<String, JsonElement> entry2 : asmStatusEntrySet) {
								asmDetailsMap.put(entry2.getKey(), entry2.getValue().toString());
							}
							asmStatus.put(entry.getKey(), asmDetailsMap);
						}
						//取磁盘组运行状态
						JsonObject diskStatusJson = (JsonObject)jsonObject.get("diskgroup_status");
						Set<Entry<String, JsonElement>> diskStatusSet = diskStatusJson.entrySet();
						Map<String, Object> diskGroupStatus = new HashMap<String, Object>();
						Map<String, String> diskGroupDetailsMap = new HashMap<String, String>();
						for (Entry<String, JsonElement> entry : diskStatusSet) {
							JsonObject diskGroupStatusObject = (JsonObject)entry.getValue();
							Set<Entry<String, JsonElement>> diskStatusEntrySet = diskGroupStatusObject.entrySet();
							for (Entry<String, JsonElement> entry2 : diskStatusEntrySet) {
								diskGroupDetailsMap.put(entry2.getKey(), entry2.getValue().toString());
							}
							diskGroupStatus.put(entry.getKey(), diskGroupDetailsMap);
						}
						//监听运行状态
						JsonObject listenStatusJson = (JsonObject)jsonObject.get("listen_status");
						Set<Entry<String, JsonElement>> listenStatusSet = listenStatusJson.entrySet();
						Map<String, Object> listenStatus = new HashMap<String, Object>();
						Map<String, String> listenDetailsMap = new HashMap<String, String>();
						for (Entry<String, JsonElement> entry : listenStatusSet) {
							JsonObject listenStatusObject = (JsonObject)entry.getValue();
							Set<Entry<String, JsonElement>> listenStatusEntrySet = listenStatusObject.entrySet();
							for (Entry<String, JsonElement> entry2 : listenStatusEntrySet) {
								listenDetailsMap.put(entry2.getKey(), entry2.getValue().toString());
							}
							listenStatus.put(entry.getKey(), listenDetailsMap);
						}
						//网络IP状态
						JsonObject netIpStatusJson = (JsonObject)jsonObject.get("net_ip_status");
						Set<Entry<String, JsonElement>> netIpStatusSet = netIpStatusJson.entrySet();
						Map<String, Object> netIpStatus = new HashMap<String, Object>();//网络IP状态
						Map<String, String> netIpDetailsMap = new HashMap<String, String>();
						for (Entry<String, JsonElement> entry : netIpStatusSet) {
							entry.getKey();
							JsonObject statusDetails = (JsonObject)entry.getValue();
							Set<Entry<String, JsonElement>> statusDetailsSet = statusDetails.entrySet();
							for (Entry<String, JsonElement> entry2 : statusDetailsSet) {
								netIpDetailsMap.put(entry2.getKey(), entry2.getValue().toString());
							}
							netIpStatus.put(entry.getKey(), netIpDetailsMap);
						}
						//实例运行状态
						JsonObject instanceJson = (JsonObject)jsonObject.get("instance_status");
						Set<Entry<String, JsonElement>> instanceSet = instanceJson.entrySet();
						Map<String, Object> instanceStatus = new HashMap<String, Object>();
						Map<String, String> instanceDetailsMap = new HashMap<String, String>();
						for (Entry<String, JsonElement> entry : instanceSet) {
							JsonObject instanceStatusObject = (JsonObject)entry.getValue();
							Set<Entry<String, JsonElement>> instanceStatusEntrySet = instanceStatusObject.entrySet();
							for (Entry<String, JsonElement> entry2 : instanceStatusEntrySet) {
								instanceDetailsMap.put(entry2.getKey(), entry2.getValue().toString());
							}
							instanceStatus.put(entry.getKey(), instanceDetailsMap);
						}
						//端口状态
						jsonObject = jsonArray.get(0).getAsJsonObject();
						JsonArray array = jsonObject.get("port_status").getAsJsonArray();
						Map<String, Object> portStatus = new HashMap<String, Object>();
						for (int j = 0; j < array.size(); j++) {
							JsonArray array2 = array.get(j).getAsJsonArray();
							String key = array2.get(0).getAsString();
							String value = array2.get(1).getAsString();
							portStatus.put(key, value);
						}
						String tmpfsTotalString = jsonObject.get("tmpfs_total").getAsString();
						Double tmpfsTotal = Double.valueOf(tmpfsTotalString.substring(0,tmpfsTotalString.length()-1));
						oracleInfo = new OracleInfo(jsonObject.get("tmpfs_used_per").getAsDouble(), tmpfsTotal, 
								null, jsonObject.get("status").getAsString(), jsonObject.get("process_current").getAsInt(), 
								null, null, 
								null, jsonObject.get("ohas_status").getAsString(), jsonObject.get("crs_status").getAsString(),
								jsonObject.get("css_status").getAsString(), asmStatus, diskGroupStatus, listenStatus, 
								netIpStatus, instanceStatus, null,portStatus,jsonArray.get(1).getAsLong(),ip);
						oracleInfos.add(oracleInfo);
					}else {
						//端口状态
						jsonObject = jsonArray.get(0).getAsJsonObject();
						JsonArray array = jsonObject.get("port_status").getAsJsonArray();
						Map<String, Object> portStatus = new HashMap<String, Object>();
						for (int j = 0; j < array.size(); j++) {
							JsonArray array2 = array.get(j).getAsJsonArray();
							String key = array2.get(0).getAsString();
							String value = array2.get(1).getAsString();
							portStatus.put(key, value);
						}
						String tmpfsTotalString = jsonObject.get("tmpfs_total").getAsString();
						Double tmpfsTotal = Double.valueOf(tmpfsTotalString.substring(0,tmpfsTotalString.length()-1));
						oracleInfo = new OracleInfo(jsonObject.get("tmpfs_used_per").getAsDouble(), tmpfsTotal, 
								null, jsonObject.get("status").getAsString(), jsonObject.get("process_current").getAsInt(), 
								null, null, 
								null, jsonObject.get("ohas_status").getAsString(), jsonObject.get("crs_status").getAsString(),
								jsonObject.get("css_status").getAsString(), null, null, null, 
								null, null, null,portStatus,jsonArray.get(1).getAsLong(),ip);
						oracleInfos.add(oracleInfo);
					}
				}else {
					if("online".equals(jsonObject.get("css_status").getAsString())&&"online".equals(jsonObject.get("ohas_status").getAsString())&&"online".equals(jsonObject.get("crs_status").getAsString())){
						//取asm运行状态
						JsonObject asmStatusJson = (JsonObject)jsonObject.get("asm_status");
						Set<Entry<String, JsonElement>> asmStatusSet = asmStatusJson.entrySet();
						Map<String, Object> asmStatus = new HashMap<String, Object>();
						Map<String, String> asmDetailsMap = new HashMap<String, String>();
						for (Entry<String, JsonElement> entry : asmStatusSet) {
							JsonObject asmStatusObject = (JsonObject)entry.getValue();
							Set<Entry<String, JsonElement>> asmStatusEntrySet = asmStatusObject.entrySet();
							for (Entry<String, JsonElement> entry2 : asmStatusEntrySet) {
								asmDetailsMap.put(entry2.getKey(), entry2.getValue().toString());
							}
							asmStatus.put(entry.getKey(), asmDetailsMap);
						}
						//取磁盘组运行状态
						JsonObject diskStatusJson = (JsonObject)jsonObject.get("diskgroup_status");
						Set<Entry<String, JsonElement>> diskStatusSet = diskStatusJson.entrySet();
						Map<String, Object> diskGroupStatus = new HashMap<String, Object>();
						Map<String, String> diskGroupDetailsMap = new HashMap<String, String>();
						for (Entry<String, JsonElement> entry : diskStatusSet) {
							JsonObject diskGroupStatusObject = (JsonObject)entry.getValue();
							Set<Entry<String, JsonElement>> diskStatusEntrySet = diskGroupStatusObject.entrySet();
							for (Entry<String, JsonElement> entry2 : diskStatusEntrySet) {
								diskGroupDetailsMap.put(entry2.getKey(), entry2.getValue().toString());
							}
							diskGroupStatus.put(entry.getKey(), diskGroupDetailsMap);
						}
						//监听运行状态
						JsonObject listenStatusJson = (JsonObject)jsonObject.get("listen_status");
						Set<Entry<String, JsonElement>> listenStatusSet = listenStatusJson.entrySet();
						Map<String, Object> listenStatus = new HashMap<String, Object>();
						Map<String, String> listenDetailsMap = new HashMap<String, String>();
						for (Entry<String, JsonElement> entry : listenStatusSet) {
							JsonObject listenStatusObject = (JsonObject)entry.getValue();
							Set<Entry<String, JsonElement>> listenStatusEntrySet = listenStatusObject.entrySet();
							for (Entry<String, JsonElement> entry2 : listenStatusEntrySet) {
								listenDetailsMap.put(entry2.getKey(), entry2.getValue().toString());
							}
							listenStatus.put(entry.getKey(), listenDetailsMap);
						}
						//网络IP状态
						JsonObject netIpStatusJson = (JsonObject)jsonObject.get("net_ip_status");
						Set<Entry<String, JsonElement>> netIpStatusSet = netIpStatusJson.entrySet();
						Map<String, Object> netIpStatus = new HashMap<String, Object>();//网络IP状态
						Map<String, String> netIpDetailsMap = new HashMap<String, String>();
						for (Entry<String, JsonElement> entry : netIpStatusSet) {
							entry.getKey();
							JsonObject statusDetails = (JsonObject)entry.getValue();
							Set<Entry<String, JsonElement>> statusDetailsSet = statusDetails.entrySet();
							for (Entry<String, JsonElement> entry2 : statusDetailsSet) {
								netIpDetailsMap.put(entry2.getKey(), entry2.getValue().toString());
							}
							netIpStatus.put(entry.getKey(), netIpDetailsMap);
						}
						//实例运行状态
						JsonObject instanceJson = (JsonObject)jsonObject.get("instance_status");
						Set<Entry<String, JsonElement>> instanceSet = instanceJson.entrySet();
						Map<String, Object> instanceStatus = new HashMap<String, Object>();
						Map<String, String> instanceDetailsMap = new HashMap<String, String>();
						for (Entry<String, JsonElement> entry : instanceSet) {
							JsonObject instanceStatusObject = (JsonObject)entry.getValue();
							Set<Entry<String, JsonElement>> instanceStatusEntrySet = instanceStatusObject.entrySet();
							for (Entry<String, JsonElement> entry2 : instanceStatusEntrySet) {
								instanceDetailsMap.put(entry2.getKey(), entry2.getValue().toString());
							}
							instanceStatus.put(entry.getKey(), instanceDetailsMap);
						}
						//表空间使用率
						JsonObject tablespaceJson = (JsonObject)jsonObject.get("tablespace_used_per");
						Set<Entry<String, JsonElement>> tablespaceSet = tablespaceJson.entrySet();
						Map<String, Object> tablespaceUsedPer = new HashMap<String, Object>();//网络IP状态
						for (Entry<String, JsonElement> entry : tablespaceSet) {
							tablespaceUsedPer.put(entry.getKey(), entry.getValue().getAsDouble());
						}
						//端口状态
						jsonObject = jsonArray.get(0).getAsJsonObject();
						JsonArray array = jsonObject.get("port_status").getAsJsonArray();
						Map<String, Object> portStatus = new HashMap<String, Object>();
						for (int j = 0; j < array.size(); j++) {
							JsonArray array2 = array.get(j).getAsJsonArray();
							String key = array2.get(0).getAsString();
							String value = array2.get(1).getAsString();
							portStatus.put(key, value);
						}
						Integer connections = null;
						if(jsonObject.get("connections") != null){
							connections = jsonObject.get("connections").getAsInt();
						}
						Integer connectionsActive = null;
						if(jsonObject.get("connections_active") != null){
							connectionsActive = jsonObject.get("connections_active").getAsInt();
						}
						
						Integer maxConnections = null;
						if(jsonObject.get("max_connections") != null){
							maxConnections = jsonObject.get("max_connections").getAsInt();
						}
						Double memoryTarget =null;
						if(jsonObject.get("memory_target") != null){
							memoryTarget = jsonObject.get("memory_target").getAsDouble();
						}
						String tmpfsTotalString = jsonObject.get("tmpfs_total").getAsString();
						Double tmpfsTotal = Double.valueOf(tmpfsTotalString.substring(0,tmpfsTotalString.length()-1));
						oracleInfo = new OracleInfo(jsonObject.get("tmpfs_used_per").getAsDouble(), tmpfsTotal, 
								memoryTarget, jsonObject.get("status").getAsString(), jsonObject.get("process_current").getAsInt(), 
								connections, connectionsActive, 
								maxConnections, jsonObject.get("ohas_status").getAsString(), jsonObject.get("crs_status").getAsString(),
								jsonObject.get("css_status").getAsString(), asmStatus, diskGroupStatus, listenStatus, 
								netIpStatus, instanceStatus, tablespaceUsedPer,portStatus,jsonArray.get(1).getAsLong(),ip);
						oracleInfos.add(oracleInfo);
					}else {
						
						//表空间使用率
						JsonObject tablespaceJson = (JsonObject)jsonObject.get("tablespace_used_per");
						Set<Entry<String, JsonElement>> tablespaceSet = tablespaceJson.entrySet();
						Map<String, Object> tablespaceUsedPer = new HashMap<String, Object>();//网络IP状态
						for (Entry<String, JsonElement> entry : tablespaceSet) {
							tablespaceUsedPer.put(entry.getKey(), entry.getValue().getAsDouble());
						}
						//端口状态
						jsonObject = jsonArray.get(0).getAsJsonObject();
						JsonArray array = jsonObject.get("port_status").getAsJsonArray();
						Map<String, Object> portStatus = new HashMap<String, Object>();
						for (int j = 0; j < array.size(); j++) {
							JsonArray array2 = array.get(j).getAsJsonArray();
							String key = array2.get(0).getAsString();
							String value = array2.get(1).getAsString();
							portStatus.put(key, value);
						}
						Integer connections = null;
						if(jsonObject.get("connections") != null){
							connections = jsonObject.get("connections").getAsInt();
						}
						Integer connectionsActive = null;
						if(jsonObject.get("connections_active") != null){
							connectionsActive = jsonObject.get("connections_active").getAsInt();
						}
						
						Integer maxConnections = null;
						if(jsonObject.get("max_connections") != null){
							maxConnections = jsonObject.get("max_connections").getAsInt();
						}
						Double memoryTarget =null;
						if(jsonObject.get("memory_target") != null){
							memoryTarget = jsonObject.get("memory_target").getAsDouble();
						}
						String tmpfsTotalString = jsonObject.get("tmpfs_total").getAsString();
						Double tmpfsTotal = Double.valueOf(tmpfsTotalString.substring(0,tmpfsTotalString.length()-1));
						oracleInfo = new OracleInfo(jsonObject.get("tmpfs_used_per").getAsDouble(), tmpfsTotal, 
								memoryTarget, jsonObject.get("status").getAsString(), jsonObject.get("process_current").getAsInt(), 
								connections, connectionsActive, 
								maxConnections, jsonObject.get("ohas_status").getAsString(), jsonObject.get("crs_status").getAsString(),
								jsonObject.get("css_status").getAsString(), null, null, null, 
								null, null, tablespaceUsedPer,portStatus,jsonArray.get(1).getAsLong(),ip);
						oracleInfos.add(oracleInfo);
						
					}
				}
			}
		}
		jedis.close();
		return oracleInfos;
		
	}
	/**
	 * 得到最新的Oracle运行状态信息
	 * @param ip
	 * @return
	 */
	public OracleInfo getNewOracleInfo(String ip){
		Jedis jedis = RedisUtil.getJedis();
		OracleInfo oracleInfo;
		try {
			List<String> jsonList = jedis.lrange("StatusData_" + ip + "_ORACLERAC_latest", -1, -1);
				JsonArray jsonArray = JsonUtil.JsonParse(jsonList.get(0));
				JsonObject jsonObject = jsonArray.get(0).getAsJsonObject();
				if ("off".equals(jsonObject.get("status").getAsString().toLowerCase())) {
					if("online".equals(jsonObject.get("css_status").getAsString())&&"online".equals(jsonObject.get("ohas_status").getAsString())&&"online".equals(jsonObject.get("crs_status").getAsString())){
						//取asm运行状态
						JsonObject asmStatusJson = (JsonObject)jsonObject.get("asm_status");
						Set<Entry<String, JsonElement>> asmStatusSet = asmStatusJson.entrySet();
						Map<String, Object> asmStatus = new HashMap<String, Object>();
						Map<String, String> asmDetailsMap = new HashMap<String, String>();
						for (Entry<String, JsonElement> entry : asmStatusSet) {
							JsonObject asmStatusObject = (JsonObject)entry.getValue();
							Set<Entry<String, JsonElement>> asmStatusEntrySet = asmStatusObject.entrySet();
							for (Entry<String, JsonElement> entry2 : asmStatusEntrySet) {
								asmDetailsMap.put(entry2.getKey(), entry2.getValue().toString());
							}
							asmStatus.put(entry.getKey(), asmDetailsMap);
						}
						//取磁盘组运行状态
						JsonObject diskStatusJson = (JsonObject)jsonObject.get("diskgroup_status");
						Set<Entry<String, JsonElement>> diskStatusSet = diskStatusJson.entrySet();
						Map<String, Object> diskGroupStatus = new HashMap<String, Object>();
						Map<String, String> diskGroupDetailsMap = new HashMap<String, String>();
						for (Entry<String, JsonElement> entry : diskStatusSet) {
							JsonObject diskGroupStatusObject = (JsonObject)entry.getValue();
							Set<Entry<String, JsonElement>> diskStatusEntrySet = diskGroupStatusObject.entrySet();
							for (Entry<String, JsonElement> entry2 : diskStatusEntrySet) {
								diskGroupDetailsMap.put(entry2.getKey(), entry2.getValue().toString());
							}
							diskGroupStatus.put(entry.getKey(), diskGroupDetailsMap);
						}
						//监听运行状态
						JsonObject listenStatusJson = (JsonObject)jsonObject.get("listen_status");
						Set<Entry<String, JsonElement>> listenStatusSet = listenStatusJson.entrySet();
						Map<String, Object> listenStatus = new HashMap<String, Object>();
						Map<String, String> listenDetailsMap = new HashMap<String, String>();
						for (Entry<String, JsonElement> entry : listenStatusSet) {
							JsonObject listenStatusObject = (JsonObject)entry.getValue();
							Set<Entry<String, JsonElement>> listenStatusEntrySet = listenStatusObject.entrySet();
							for (Entry<String, JsonElement> entry2 : listenStatusEntrySet) {
								listenDetailsMap.put(entry2.getKey(), entry2.getValue().toString());
							}
							listenStatus.put(entry.getKey(), listenDetailsMap);
						}
						//网络IP状态
						JsonObject netIpStatusJson = (JsonObject)jsonObject.get("net_ip_status");
						Set<Entry<String, JsonElement>> netIpStatusSet = netIpStatusJson.entrySet();
						Map<String, Object> netIpStatus = new HashMap<String, Object>();//网络IP状态
						Map<String, String> netIpDetailsMap = new HashMap<String, String>();
						for (Entry<String, JsonElement> entry : netIpStatusSet) {
							entry.getKey();
							JsonObject statusDetails = (JsonObject)entry.getValue();
							Set<Entry<String, JsonElement>> statusDetailsSet = statusDetails.entrySet();
							for (Entry<String, JsonElement> entry2 : statusDetailsSet) {
								netIpDetailsMap.put(entry2.getKey(), entry2.getValue().toString());
							}
							netIpStatus.put(entry.getKey(), netIpDetailsMap);
						}
						//实例运行状态
						JsonObject instanceJson = (JsonObject)jsonObject.get("instance_status");
						Set<Entry<String, JsonElement>> instanceSet = instanceJson.entrySet();
						Map<String, Object> instanceStatus = new HashMap<String, Object>();
						Map<String, String> instanceDetailsMap = new HashMap<String, String>();
						for (Entry<String, JsonElement> entry : instanceSet) {
							JsonObject instanceStatusObject = (JsonObject)entry.getValue();
							Set<Entry<String, JsonElement>> instanceStatusEntrySet = instanceStatusObject.entrySet();
							for (Entry<String, JsonElement> entry2 : instanceStatusEntrySet) {
								instanceDetailsMap.put(entry2.getKey(), entry2.getValue().toString());
							}
							instanceStatus.put(entry.getKey(), instanceDetailsMap);
						}
						//端口状态
						jsonObject = jsonArray.get(0).getAsJsonObject();
						JsonArray array = jsonObject.get("port_status").getAsJsonArray();
						Map<String, Object> portStatus = new HashMap<String, Object>();
						for (int j = 0; j < array.size(); j++) {
							JsonArray array2 = array.get(j).getAsJsonArray();
							String key = array2.get(0).getAsString();
							String value = array2.get(1).getAsString();
							portStatus.put(key, value);
						}
						String tmpfsTotalString = jsonObject.get("tmpfs_total").getAsString();
						Double tmpfsTotal = Double.valueOf(tmpfsTotalString.substring(0,tmpfsTotalString.length()-1));
						oracleInfo = new OracleInfo(jsonObject.get("tmpfs_used_per").getAsDouble(), tmpfsTotal, 
								null, jsonObject.get("status").getAsString(), jsonObject.get("process_current").getAsInt(), 
								null, null, 
								null, jsonObject.get("ohas_status").getAsString(), jsonObject.get("crs_status").getAsString(),
								jsonObject.get("css_status").getAsString(), asmStatus, diskGroupStatus, listenStatus, 
								netIpStatus, instanceStatus, null,portStatus,jsonArray.get(1).getAsLong(),ip);
					}else {
						//端口状态
						jsonObject = jsonArray.get(0).getAsJsonObject();
						JsonArray array = jsonObject.get("port_status").getAsJsonArray();
						Map<String, Object> portStatus = new HashMap<String, Object>();
						for (int j = 0; j < array.size(); j++) {
							JsonArray array2 = array.get(j).getAsJsonArray();
							String key = array2.get(0).getAsString();
							String value = array2.get(1).getAsString();
							portStatus.put(key, value);
						}
						String tmpfsTotalString = jsonObject.get("tmpfs_total").getAsString();
						Double tmpfsTotal = Double.valueOf(tmpfsTotalString.substring(0,tmpfsTotalString.length()-1));
						oracleInfo = new OracleInfo(jsonObject.get("tmpfs_used_per").getAsDouble(), tmpfsTotal, 
								null, jsonObject.get("status").getAsString(), jsonObject.get("process_current").getAsInt(), 
								null, null, 
								null, jsonObject.get("ohas_status").getAsString(), jsonObject.get("crs_status").getAsString(),
								jsonObject.get("css_status").getAsString(), null, null, null, 
								null, null, null,portStatus,jsonArray.get(1).getAsLong(),ip);
					}
				}else {
					if("online".equals(jsonObject.get("css_status").getAsString())&&"online".equals(jsonObject.get("ohas_status").getAsString())&&"online".equals(jsonObject.get("crs_status").getAsString())){
						//取asm运行状态
						JsonObject asmStatusJson = (JsonObject)jsonObject.get("asm_status");
						Set<Entry<String, JsonElement>> asmStatusSet = asmStatusJson.entrySet();
						Map<String, Object> asmStatus = new HashMap<String, Object>();
						Map<String, String> asmDetailsMap = new HashMap<String, String>();
						for (Entry<String, JsonElement> entry : asmStatusSet) {
							JsonObject asmStatusObject = (JsonObject)entry.getValue();
							Set<Entry<String, JsonElement>> asmStatusEntrySet = asmStatusObject.entrySet();
							for (Entry<String, JsonElement> entry2 : asmStatusEntrySet) {
								asmDetailsMap.put(entry2.getKey(), entry2.getValue().toString());
							}
							asmStatus.put(entry.getKey(), asmDetailsMap);
						}
						//取磁盘组运行状态
						JsonObject diskStatusJson = (JsonObject)jsonObject.get("diskgroup_status");
						Set<Entry<String, JsonElement>> diskStatusSet = diskStatusJson.entrySet();
						Map<String, Object> diskGroupStatus = new HashMap<String, Object>();
						Map<String, String> diskGroupDetailsMap = new HashMap<String, String>();
						for (Entry<String, JsonElement> entry : diskStatusSet) {
							JsonObject diskGroupStatusObject = (JsonObject)entry.getValue();
							Set<Entry<String, JsonElement>> diskStatusEntrySet = diskGroupStatusObject.entrySet();
							for (Entry<String, JsonElement> entry2 : diskStatusEntrySet) {
								diskGroupDetailsMap.put(entry2.getKey(), entry2.getValue().toString());
							}
							diskGroupStatus.put(entry.getKey(), diskGroupDetailsMap);
						}
						//监听运行状态
						JsonObject listenStatusJson = (JsonObject)jsonObject.get("listen_status");
						Set<Entry<String, JsonElement>> listenStatusSet = listenStatusJson.entrySet();
						Map<String, Object> listenStatus = new HashMap<String, Object>();
						Map<String, String> listenDetailsMap = new HashMap<String, String>();
						for (Entry<String, JsonElement> entry : listenStatusSet) {
							JsonObject listenStatusObject = (JsonObject)entry.getValue();
							Set<Entry<String, JsonElement>> listenStatusEntrySet = listenStatusObject.entrySet();
							for (Entry<String, JsonElement> entry2 : listenStatusEntrySet) {
								listenDetailsMap.put(entry2.getKey(), entry2.getValue().toString());
							}
							listenStatus.put(entry.getKey(), listenDetailsMap);
						}
						//网络IP状态
						JsonObject netIpStatusJson = (JsonObject)jsonObject.get("net_ip_status");
						Set<Entry<String, JsonElement>> netIpStatusSet = netIpStatusJson.entrySet();
						Map<String, Object> netIpStatus = new HashMap<String, Object>();//网络IP状态
						Map<String, String> netIpDetailsMap = new HashMap<String, String>();
						for (Entry<String, JsonElement> entry : netIpStatusSet) {
							entry.getKey();
							JsonObject statusDetails = (JsonObject)entry.getValue();
							Set<Entry<String, JsonElement>> statusDetailsSet = statusDetails.entrySet();
							for (Entry<String, JsonElement> entry2 : statusDetailsSet) {
								netIpDetailsMap.put(entry2.getKey(), entry2.getValue().toString());
							}
							netIpStatus.put(entry.getKey(), netIpDetailsMap);
						}
						//实例运行状态
						JsonObject instanceJson = (JsonObject)jsonObject.get("instance_status");
						Set<Entry<String, JsonElement>> instanceSet = instanceJson.entrySet();
						Map<String, Object> instanceStatus = new HashMap<String, Object>();
						Map<String, String> instanceDetailsMap = new HashMap<String, String>();
						for (Entry<String, JsonElement> entry : instanceSet) {
							JsonObject instanceStatusObject = (JsonObject)entry.getValue();
							Set<Entry<String, JsonElement>> instanceStatusEntrySet = instanceStatusObject.entrySet();
							for (Entry<String, JsonElement> entry2 : instanceStatusEntrySet) {
								instanceDetailsMap.put(entry2.getKey(), entry2.getValue().toString());
							}
							instanceStatus.put(entry.getKey(), instanceDetailsMap);
						}
						//表空间使用率
						JsonObject tablespaceJson = (JsonObject)jsonObject.get("tablespace_used_per");
						Set<Entry<String, JsonElement>> tablespaceSet = tablespaceJson.entrySet();
						Map<String, Object> tablespaceUsedPer = new HashMap<String, Object>();//网络IP状态
						for (Entry<String, JsonElement> entry : tablespaceSet) {
							tablespaceUsedPer.put(entry.getKey(), entry.getValue().getAsDouble());
						}
						//端口状态
						jsonObject = jsonArray.get(0).getAsJsonObject();
						JsonArray array = jsonObject.get("port_status").getAsJsonArray();
						Map<String, Object> portStatus = new HashMap<String, Object>();
						for (int j = 0; j < array.size(); j++) {
							JsonArray array2 = array.get(j).getAsJsonArray();
							String key = array2.get(0).getAsString();
							String value = array2.get(1).getAsString();
							portStatus.put(key, value);
						}
						Integer connections = null;
						if(jsonObject.get("connections") != null){
							connections = jsonObject.get("connections").getAsInt();
						}
						Integer connectionsActive = null;
						if(jsonObject.get("connections_active") != null){
							connectionsActive = jsonObject.get("connections_active").getAsInt();
						}
						
						Integer maxConnections = null;
						if(jsonObject.get("max_connections") != null){
							maxConnections = jsonObject.get("max_connections").getAsInt();
						}
						Double memoryTarget =null;
						if(jsonObject.get("memory_target") != null){
							memoryTarget = jsonObject.get("memory_target").getAsDouble();
						}
						String tmpfsTotalString = jsonObject.get("tmpfs_total").getAsString();
						Double tmpfsTotal = Double.valueOf(tmpfsTotalString.substring(0,tmpfsTotalString.length()-1));
						oracleInfo = new OracleInfo(jsonObject.get("tmpfs_used_per").getAsDouble(), tmpfsTotal, 
								memoryTarget, jsonObject.get("status").getAsString(), jsonObject.get("process_current").getAsInt(), 
								connections, connectionsActive, 
								maxConnections, jsonObject.get("ohas_status").getAsString(), jsonObject.get("crs_status").getAsString(),
								jsonObject.get("css_status").getAsString(), asmStatus, diskGroupStatus, listenStatus, 
								netIpStatus, instanceStatus, tablespaceUsedPer,portStatus,jsonArray.get(1).getAsLong(),ip);
					}else {
						
						//表空间使用率
						JsonObject tablespaceJson = (JsonObject)jsonObject.get("tablespace_used_per");
						Set<Entry<String, JsonElement>> tablespaceSet = tablespaceJson.entrySet();
						Map<String, Object> tablespaceUsedPer = new HashMap<String, Object>();//网络IP状态
						for (Entry<String, JsonElement> entry : tablespaceSet) {
							tablespaceUsedPer.put(entry.getKey(), entry.getValue().getAsDouble());
						}
						//端口状态
						jsonObject = jsonArray.get(0).getAsJsonObject();
						JsonArray array = jsonObject.get("port_status").getAsJsonArray();
						Map<String, Object> portStatus = new HashMap<String, Object>();
						for (int j = 0; j < array.size(); j++) {
							JsonArray array2 = array.get(j).getAsJsonArray();
							String key = array2.get(0).getAsString();
							String value = array2.get(1).getAsString();
							portStatus.put(key, value);
						}
						Integer connections = null;
						if(jsonObject.get("connections") != null){
							connections = jsonObject.get("connections").getAsInt();
						}
						Integer connectionsActive = null;
						if(jsonObject.get("connections_active") != null){
							connectionsActive = jsonObject.get("connections_active").getAsInt();
						}
						
						Integer maxConnections = null;
						if(jsonObject.get("max_connections") != null){
							maxConnections = jsonObject.get("max_connections").getAsInt();
						}
						Double memoryTarget =null;
						if(jsonObject.get("memory_target") != null){
							memoryTarget = jsonObject.get("memory_target").getAsDouble();
						}
						String tmpfsTotalString = jsonObject.get("tmpfs_total").getAsString();
						Double tmpfsTotal = Double.valueOf(tmpfsTotalString.substring(0,tmpfsTotalString.length()-1));
						oracleInfo = new OracleInfo(jsonObject.get("tmpfs_used_per").getAsDouble(), tmpfsTotal, 
								memoryTarget, jsonObject.get("status").getAsString(), jsonObject.get("process_current").getAsInt(), 
								connections, connectionsActive, 
								maxConnections, jsonObject.get("ohas_status").getAsString(), jsonObject.get("crs_status").getAsString(),
								jsonObject.get("css_status").getAsString(), null, null, null, 
								null, null, tablespaceUsedPer,portStatus,jsonArray.get(1).getAsLong(),ip);
						
					}
				}
		} catch (Exception e) {
			// TODO Auto-generated catch block
			return new OracleInfo(null, null, null, null, null, null, null, null, null, 
					null, null, null, null, null, null, null, null, null, null,null);
		}finally{
			jedis.close();			
		}
			return oracleInfo;
	}
}
